/**
 * 
 */
package org.swing.utility.input.panel;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.BoxLayout;
import javax.swing.JPanel;

/**
 * @author lqnhu
 *
 */
public final class JPanelUtility {
	/**
	 * Utility class.
	 */
	private JPanelUtility() {
		// NOP
	}

	public static JPanel setBorderLayout(final JPanel panel) {
		panel.setLayout(new BorderLayout());
		return panel;
	}

	public static JPanel setFlowLayoutLeft(final JPanel panel) {
		panel.setLayout(new FlowLayout(FlowLayout.LEFT));
		return panel;
	}

	public static JPanel setFlowLayoutCenter(final JPanel panel) {
		panel.setLayout(new FlowLayout(FlowLayout.CENTER));
		return panel;
	}

	public static JPanel setFlowLayoutRight(final JPanel panel) {
		panel.setLayout(new FlowLayout(FlowLayout.RIGHT));
		return panel;
	}

	public static JPanel setBoxLayoutHorizontal(final JPanel panel) {
		panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
		return panel;
	}

	public static JPanel setBoxLayoutVertical(final JPanel panel) {
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
		return panel;
	}
}	
